import { Controller } from "../../mvc/core/Controller";
import { AttachedSoulBattlefieldExplainWindow } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldExplainWindow";
import { AttachedSoulBattlefielResultWindow } from "../view/attachedSoulBattlefield/AttachedSoulBattlefielResultWindow";
import { AttachedSoulMultiplicitySelectView } from "../view/attachedSoulBattlefield/AttachedSoulMultiplicitySelectView";
import { AttachedSoulBattlefielListInfoView } from "../view/attachedSoulBattlefield/AttachedSoulBattlefielListInfoView";
import { ILayer } from "../../mvc/interfaces/ILayer";
import { AttachedSoulBattlefieldWaitingTimeView } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldWaitingTimeView";
import { AttachedSoulBattlefieldInfoView } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldInfoView";
import { DataEvent } from "../events/DataEvent";
import { AttachedSoulBattlefieldOperateVo } from "../view/attachedSoulBattlefield/vo/AttachedSoulBattlefieldOperateVo";
import { GameProxy } from "../mvc/GameProxy";
import { AttachedSoulBattlefielAids } from "../view/attachedSoulBattlefield/AttachedSoulBattlefielAids";
import { ArenaGroupView } from "../view/arena/ArenaGroupView";
import { IView } from "../../mvc/interfaces/IView";
import { AttachedSoulBattlefieldModule } from "../../../modules/AttachedSoulBattlefieldModule";
import { WindowEvent } from "../../component/window/WindowEvent";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { EPublicCommand } from "../../../Message/Command/EPublicCommand";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { Alert } from "../../../com/mui/controls/Alert";
import { Language } from "../../../extend/language/Language";
import { SAttribute } from "../../../Message/Public/SAttribute";
import { IAttachedSoulBattlefieldModule } from "../../../modules/interfaces/IAttachedSoulBattlefieldModule";
import { AttachedSoulBattlefieldUtil } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldUtil";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { SPushCrossSWFightPlayerInfo } from "../../../Message/Public/SPushCrossSWFightPlayerInfo";
import { AttachedSoulBattlefieldTeamType } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldTeamType";
import { EEntityFightMode } from "../../../Message/Public/EEntityFightMode";
import { GangFightsReadyTimeView } from "../view/gangFights/GangFightsReadyTimeView";
import { DisplayUtil } from "../../common/DisplayUtil";
import { SPushCrossSWObserveListGroupInfo } from "../../../Message/Public/SPushCrossSWObserveListGroupInfo";
import { Global } from "../../../com/gengine/global/Global";
import { GameMapUtil } from "../scene/map/GameMapUtil";
import { SCrossSpiritWarWaitingRoomOpen } from "../../../Message/Public/SCrossSpiritWarWaitingRoomOpen";
import { DateUtil } from "../../common/tools/DateUtil";
import { SCrossSWPlayerScoreInfoToClient } from "../../../Message/Public/SCrossSWPlayerScoreInfoToClient";
import { SGangFightsMatch } from "../../../Message/Public/SGangFightsMatch";
import { TimerAlertWin } from "../view/common/alertwins/TimerAlertWin";
import { SPushCrossSpiritWarWaitingRoomInfo } from "../../../Message/Public/SPushCrossSpiritWarWaitingRoomInfo";
import { SCrossSpiritWarWaitingRoomInfo } from "../../../Message/Public/SCrossSpiritWarWaitingRoomInfo";
import { SCrossSpiritWarTeamScoreInfo } from "../../../Message/Public/SCrossSpiritWarTeamScoreInfo";
import { SPushCrossSWSettlementInfo } from "../../../Message/Public/SPushCrossSWSettlementInfo";
import { AttachedSoulBattlefieldResultVo } from "../view/attachedSoulBattlefield/vo/AttachedSoulBattlefieldResultVo";
import { AttachedSoulBattlefieldIcon } from "../view/attachedSoulBattlefield/AttachedSoulBattlefieldIcon";
type int = number;
//class AttachedSoulBattlefieldController
    
    export  class AttachedSoulBattlefieldController extends Controller
    {
       

        /* internal  */get explainWindow(): AttachedSoulBattlefieldExplainWindow
        {
            if (!this._explain) 
            {
                this._explain = new AttachedSoulBattlefieldExplainWindow();
            }
            return this._explain;
        }

        /* internal  */get resultWindow(): AttachedSoulBattlefielResultWindow
        {
            if (!this._resultWindow) 
            {
                this._resultWindow = new AttachedSoulBattlefielResultWindow();
            }
            return this._resultWindow;
        }

        /* internal  */get multiplicitySelectView(): AttachedSoulMultiplicitySelectView
        {
            if (!this._multiplicitySelectView) 
            {
                this._multiplicitySelectView = new AttachedSoulMultiplicitySelectView();
            }
            return this._multiplicitySelectView;
        }

        /* internal  */get listInfoView(): AttachedSoulBattlefielListInfoView
        {
            if (!this._listInfoView) 
            {
                this._listInfoView = new AttachedSoulBattlefielListInfoView();
                this._listInfoView.layer = view as ILayer;
            }
            return this._listInfoView;
        }

        public get waitingTimeView(): AttachedSoulBattlefieldWaitingTimeView
        {
            if (!this._waitingTimeView) 
            {
                this._waitingTimeView = new AttachedSoulBattlefieldWaitingTimeView();
            }
            return this._waitingTimeView;
        }

        /* internal  */get infoView(): AttachedSoulBattlefieldInfoView
        {
            if (!this._infoView) 
            {
                this._infoView = new AttachedSoulBattlefieldInfoView();
            }
            return this._infoView;
        }

        /* internal  */onAttachedSoulBattlefieldJoinHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as AttachedSoulBattlefieldOperateVo;
            GameProxy.copy.signUpCrossSpiritWar(loc1);
            return;
        }

        public get enemyView(): AttachedSoulBattlefielAids
        {
            if (!this._enemyView) 
            {
                this._enemyView = new AttachedSoulBattlefielAids();
            }
            return this._enemyView;
        }

        /* internal  */get observeView(): AttachedSoulBattlefielAids
        {
            if (!this._observeView) 
            {
                this._observeView = new AttachedSoulBattlefielAids();
                this._observeView.isBbserveView();
            }
            return this._observeView;
        }

        public get groupView(): ArenaGroupView
        {
            if (!this._groupView) 
            {
                this._groupView = new ArenaGroupView();
                this._groupView.needShowHideBtn = true;
            }
            return this._groupView;
        }

        protected /* override */ initView(): IView
        {
            if (!this._module) 
            {
                this._module = new AttachedSoulBattlefieldModule();
                this._module.addEventListener(WindowEvent.SHOW, this.onModuleShow);
                this._module.addEventListener(WindowEvent.CLOSE, this.onModuleClose);
            }
            return this._module;
        }

        /* internal  */onExplainWindowShowHandler(arg1: DataEvent): void
        {
            if (this.explainWindow.isHide) 
            {
                this.explainWindow.show();
            }
            return;
        }

        /* internal  */onDailyPVPBattlefieldRestRoomEnterHandler(arg1: DataEvent): void
        {
            GameProxy.copy.enterCrossSpiritWar(0, true);
            return;
        }

        /* internal  */onModuleShow(arg1: WindowEvent): void
        {
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWObserveList, this.onCrossSWObserveListHandler);
            return;
        }

        /* internal  */onModuleClose(arg1: WindowEvent): void
        {
            NetDispatcher.removeCmdListener(EPublicCommand._ECmdPublicCrossSWObserveList, this.onCrossSWObserveListHandler);
            this.onListInfoViewHideHandler();
            return;
        }

        /* internal  */onSignUpCrossSWBackHandler(arg1: MessageBlock): void
        {
            if (cache.attachedSoulBattlefield.joinOrCancelSuccess && !cache.attachedSoulBattlefield.isMatchSucceed && this._isInBattlefield == false) 
            {
                if (this._alert == null || this._alert && this._alert.parent == null) 
                {
                    this._alert = Alert.show(Language.getString(28625), null, Alert.OK);
                }
            }
            var loc1=arg1.messageBase as SAttribute;
            cache.attachedSoulBattlefield.joinOrCancelSuccess = true;
            this.waitingTimeView.show();
            this.waitingTimeView.stop();
            cache.attachedSoulBattlefield.joinCoolTime = int(loc1.valueStr);
            this.waitingTimeView.time = cache.attachedSoulBattlefield.joinCoolTime;
            if (_view && !view.isHide) 
            {
                IAttachedSoulBattlefieldModule(view).joinOrCancelSuccess();
            }
            if (AttachedSoulBattlefieldUtil.isBattlefieldEnd) 
            {
                this.onCancelSignUpCrossSWBackHandler();
            }
            return;
        }

        /* internal  */onCancelSignUpCrossSWBackHandler(arg1: MessageBlock=null): void
        {
            cache.attachedSoulBattlefield.joinOrCancelSuccess = false;
            cache.attachedSoulBattlefield.joinCoolTime = 0;
            if (_view && !_view.isHide) 
            {
                IAttachedSoulBattlefieldModule(view).joinOrCancelSuccess();
            }
            this.clean();
            return;
        }

        /* internal  */onListRefreshHandler(arg1: DataEvent): void
        {
            GameProxy.copy.getCrossSpiritWarObserveList();
            return;
        }

        /* internal  */onListInfoViewHideHandler(arg1: DataEvent=null): void
        {
            if (this._listInfoView && !this._listInfoView.isHide) 
            {
                this.listInfoView.hide();
            }
            return;
        }

        /* internal  */onGetIncomeHandler(arg1: DataEvent): void
        {
            GameProxy.daily.getCrossSpiritWarIncome(arg1.data as int);
            return;
        }

        /* internal  */onGetIncomeSucceedHandler(arg1: DataEvent): void
        {
            this.multiplicitySelectView.hide();
            return;
        }

        protected /* override */ initServer(): void
        {
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefieldExplainWindowShow, this.onExplainWindowShowHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefieldRestRoomEnter, this.onDailyPVPBattlefieldRestRoomEnterHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefieldJoin, this.onAttachedSoulBattlefieldJoinHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefieldTeamInfoViewShow, this.onTeamInfoViewShowHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielApplyPanelShow, this.onApplyPanelShowHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielLeave, this.onAttachedSoulBattlefielLeaveHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielListRefresh, this.onListRefreshHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielListInfoViewHide, this.onListInfoViewHideHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielGetIncome, this.onGetIncomeHandler);
            Dispatcher.addEventListener(EventName.AttachedSoulBattlefielGetIncomeSucceed, this.onGetIncomeSucceedHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWWaitingRoomOpen, this.onCrossSWWaitingRoomOpenHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWWaitingRoomClose, this.onCrossSWWaitingRoomCloseHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWStart, this.onCrossSWStartHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWEnd, this.onCrossSWEndHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWSettlementInfo, this.onCrossSWSettlementInfoHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicUpdateTodaySpiritCoin, this.onUpdateTodaySpiritCoinHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWAllPreRecord, this.onCrossSWAllPreRecordHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWMatchFight, this.onCrossSWMatchFightHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWWaitingRoomInfo, this.onCrossSWWaitingRoomInfoHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWTeamScoreInfo, this.onCrossSWTeamScoreInfoHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicSignUpCrossSWBack, this.onSignUpCrossSWBackHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCancelSignUpCrossSWBack, this.onCancelSignUpCrossSWBackHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWEnterFightMap, this.onCrossSWEnterFightMapHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicCrossSWStartFight, this.onCrossSWStartFightHandler);
            return;
        }

        /* internal  */onCrossSWEnterFightMapHandler(arg1: MessageBlock): void
        {
            var loc5=null;
            var loc1=arg1.messageBase as SPushCrossSWFightPlayerInfo;
            var loc2=[];
            var loc3=[];
            var loc4=cache.role.entityInfo.entityId.id;
            var loc6=0;
            var loc7=loc1.vCrossSWFightPlayerInfo;
            for(loc5 of loc7) 
            {
                if (loc5.miniPlayer.entityId.id == loc4) 
                {
                    cache.attachedSoulBattlefield.mySelfType = loc5.teamId;
                    continue;
                }
                if (loc5.teamId == AttachedSoulBattlefieldTeamType.BLUE_TEAM) 
                {
                    loc3.push(loc5.miniPlayer);
                    continue;
                }
                loc2.push(loc5.miniPlayer);
            }
            if (cache.attachedSoulBattlefield.mySelfType != AttachedSoulBattlefieldTeamType.BLUE_TEAM) 
            {
                cache.attachedSoulBattlefield.myTeamInfo = loc2;
                cache.attachedSoulBattlefield.enemyTeamInfo = loc3;
            }
            else 
            {
                cache.attachedSoulBattlefield.myTeamInfo = loc3;
                cache.attachedSoulBattlefield.enemyTeamInfo = loc2;
            }
            this._isInBattlefield = true;
            if (cache.role.entityInfo.fightModel == EEntityFightMode._EEntityFightModeObseve) 
            {
                this.observeView.setEnemys(cache.attachedSoulBattlefield.myTeamInfo);
                this.observeView.show();
            }
            else 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaClearCd));
                this.groupView.updateByPlayerArray(cache.attachedSoulBattlefield.myTeamInfo);
                this.observeView.hide();
                GangFightsReadyTimeView.instance.show();
            }
            this.enemyView.setEnemys(cache.attachedSoulBattlefield.enemyTeamInfo);
            this.enemyView.show();
            this.infoView.show(650, 5);
            this.infoView.setIntegral(0, 0);
            this.infoView.tfLeftTime = AttachedSoulBattlefieldUtil.fightTime;
            view.hide();
            DisplayUtil.removeMe(this._alert);
            Dispatcher.dispatchEvent(new DataEvent(EventName.ShowGameMainUI, false));
            Dispatcher.dispatchEvent(new DataEvent(EventName.TaskTrackShowOrHide, false));
            return;
        }

        /* internal  */onCrossSWStartFightHandler(arg1: MessageBlock): void
        {
            GangFightsReadyTimeView.instance.hide();
            cache.attachedSoulBattlefield.canMove = true;
            return;
        }

        /* internal  */onCrossSWObserveListHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPushCrossSWObserveListGroupInfo;
            IAttachedSoulBattlefieldModule(view).observeList = loc1.vCrossSWObserveListGroupInfo;
            return;
        }

        /* internal  */onTeamInfoViewShowHandler(arg1: DataEvent): void
        {
            var loc1=AttachedSoulBattlefieldModule(view).globalToLocal(new Object /* flash.geom.Point */(Global.stage.mouseX, Global.stage.mouseY));
            this.listInfoView.show(loc1.x, loc1.y);
            this.listInfoView.data = arg1.data as Array<any>;
            return;
        }

        /* internal  */onApplyPanelShowHandler(arg1: DataEvent): void
        {
            view.show();
            IAttachedSoulBattlefieldModule(view).joinOrCancelSuccess();
            IAttachedSoulBattlefieldModule(view).applyList = cache.attachedSoulBattlefield.applyList;
            IAttachedSoulBattlefieldModule(view).todaySpiritCoin = cache.attachedSoulBattlefield.todaySpiritCoin;
            return;
        }

        /* internal  */onAttachedSoulBattlefielLeaveHandler(arg1: DataEvent): void
        {
            var e: DataEvent;
            var onBtnClickHandler: Function;

            var loc1;
            onBtnClickHandler = null;
            e = arg1;
            onBtnClickHandler = (arg1: int): void
            {
                if (arg1 == Alert.YES) 
                {
                    GameProxy.copy.enterCrossSpiritWar(0, true);
                }
                return;
            }
            if (e.data.needShowAlert) 
            {
                Alert.show(e.data.str, null, Alert.YES | Alert.NO, null, onBtnClickHandler);
            }
            else 
            {
                onBtnClickHandler(Alert.YES);
            }
            return;
        }

        /* internal  */onSceneUpdate(arg1: DataEvent): void
        {
            if (this._isInBattlefield && !GameMapUtil.curMapState.isCrossSpiritWarCopyCode) 
            {
                this._isInBattlefield = false;
                cache.attachedSoulBattlefield.canMove = false;
                cache.attachedSoulBattlefield.isMatchSucceed = false;
                this.groupView.clean();
                this.onCancelSignUpCrossSWBackHandler();
                Dispatcher.dispatchEvent(new DataEvent(EventName.ShowGameMainUI, true));
                Dispatcher.dispatchEvent(new DataEvent(EventName.TaskTrackShowOrHide, true));
            }
            return;
        }

        /* internal  */onCrossSWWaitingRoomOpenHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SCrossSpiritWarWaitingRoomOpen;
            cache.attachedSoulBattlefield.closeDt = loc1.closeDt;
            if (cache.role.entityInfo.level >= 80 && !AttachedSoulBattlefieldUtil.isBattlefieldEnd) 
            {
                this.btn.addTfLeftTime(DateUtil.getGemainingTime(loc1.openDt) + 5 * 60);
                this.btn.show();
                Dispatcher.addEventListener(EventName.Scene_Update, this.onSceneUpdate);
            }
            return;
        }

        /* internal  */onCrossSWWaitingRoomCloseHandler(arg1: MessageBlock): void
        {
            if (_view && !view.isHide) 
            {
                view.hide();
            }
            this.clean();
            Dispatcher.removeEventListener(EventName.Scene_Update, this.onSceneUpdate);
            return;
        }

        /* internal  */onCrossSWStartHandler(arg1: MessageBlock): void
        {
            return;
        }

        /* internal  */onCrossSWEndHandler(arg1: MessageBlock): void
        {
            if (this._btn) 
            {
                this.btn.hide();
            }
            if (this._waitingTimeView && !this._waitingTimeView.isHide) 
            {
                this.waitingTimeView.hide();
            }
            return;
        }

        /* internal  */onCrossSWAllPreRecordHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SCrossSWPlayerScoreInfoToClient;
            loc1.vCrossSWPlayerScoreInfo.sortOn(["score"], Array.NUMERIC | Array.DESCENDING);
            cache.attachedSoulBattlefield.applyList = loc1.vCrossSWPlayerScoreInfo;
            if (_view && !view.isHide) 
            {
                IAttachedSoulBattlefieldModule(view).applyList = loc1.vCrossSWPlayerScoreInfo;
            }
            return;
        }

        /* internal  */onCrossSWMatchFightHandler(arg1: MessageBlock): void
        {
            cache.attachedSoulBattlefield.isMatchSucceed = true;
            var loc1=arg1.messageBase as SGangFightsMatch;
            cache.attachedSoulBattlefield.battlefieldId = loc1.gangFightsId;
            this.waitingTimeView.hide();
            Alert.mode = Alert.Mode_NoneNotModal;
            Alert.alertWinRenderer = TimerAlertWin;
            Alert.needCallCloseHandler = false;
            Alert.buttonWidth = 70;
            Alert.timerOut = Math.ceil(loc1.leftEnterTime);
            Alert.okLabel = Language.getString(42203);
            this._alertSp = Alert.show(Language.getString(42205), null, Alert.OK, null, this.onClose);
            GangFightsReadyTimeView.instance.updateLeftTime(loc1.leftEnterTime + 5);
            GangFightsReadyTimeView.instance.resetPosition();
            GangFightsReadyTimeView.instance.hide();
            return;
        }

        /* internal  */onClose(arg1: int): void
        {
            GameProxy.copy.enterCrossSpiritWar(cache.attachedSoulBattlefield.battlefieldId, false);
            return;
        }

        /* internal  */onCrossSWWaitingRoomInfoHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPushCrossSpiritWarWaitingRoomInfo;
            cache.attachedSoulBattlefield.waitingRoomId = SCrossSpiritWarWaitingRoomInfo(loc1[0]).roomId;
            GameProxy.copy.enterCrossSpiritWar(cache.attachedSoulBattlefield.waitingRoomId, true);
            return;
        }

        /* internal  */onCrossSWTeamScoreInfoHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SCrossSpiritWarTeamScoreInfo;
            if (cache.attachedSoulBattlefield.mySelfType == AttachedSoulBattlefieldTeamType.BLUE_TEAM || cache.role.entityInfo.fightModel == EEntityFightMode._EEntityFightModeObseve) 
            {
                this.infoView.setIntegral(loc1.teamZeroScore, loc1.teamOneScore);
            }
            else 
            {
                this.infoView.setIntegral(loc1.teamOneScore, loc1.teamZeroScore);
            }
            return;
        }

        /* internal  */onCrossSWSettlementInfoHandler(arg1: MessageBlock): void
        {
            var loc4=0;
            var loc5=null;
            var loc1=arg1.messageBase as SPushCrossSWSettlementInfo;
            var loc2=new AttachedSoulBattlefieldResultVo();
            var loc3=cache.role.entityInfo.entityId.id;
            var loc6=0;
            var loc7=loc1.vCrossSWSettlementInfo;
            for(loc5 of loc7) 
            {
                if (loc5.teamId != AttachedSoulBattlefieldTeamType.YELLOW_TEAM) 
                {
                    loc2.blueData.push(loc5);
                    loc2.blueTeamScore = loc5.teamScore;
                    if (loc5.result == 2) 
                    {
                        loc2.result = 0;
                    }
                }
                else 
                {
                    loc2.yellowData.push(loc5);
                    loc2.yellowTeamScore = loc5.teamScore;
                    if (loc5.result == 2) 
                    {
                        loc2.result = 1;
                    }
                }
                if (loc5.miniPlayer.entityId.id != loc3) 
                {
                    continue;
                }
                loc4 = loc5.spiritCoinAdd;
            }
            this.resultWindow.data = loc2;
            this.resultWindow.show();
            if (AttachedSoulBattlefieldUtil.isInAttachedSoulBattlefield && loc4 > 0) 
            {
                this.multiplicitySelectView.show();
                this.multiplicitySelectView.reward = loc4;
            }
            return;
        }

        /* internal  */onUpdateTodaySpiritCoinHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SAttribute;
            cache.attachedSoulBattlefield.todaySpiritCoin = loc1.value;
            if (_view && !view.isHide) 
            {
                IAttachedSoulBattlefieldModule(view).todaySpiritCoin = cache.attachedSoulBattlefield.todaySpiritCoin;
            }
            return;
        }

        /* internal  */clean(): void
        {
            if (this._infoView && !this._infoView.isHide) 
            {
                this.infoView.hide();
            }
            if (this._enemyView && !this._enemyView.isHide) 
            {
                this.enemyView.hide();
            }
            if (this._groupView && !this._groupView.isHide) 
            {
                this.groupView.hide();
            }
            if (this._observeView && !this._observeView.isHide) 
            {
                this.observeView.hide();
            }
            if (this._resultWindow && !this._resultWindow.isHide) 
            {
                this.resultWindow.hide();
            }
            if (this._waitingTimeView && !this._waitingTimeView.isHide) 
            {
                this.waitingTimeView.hide();
            }
            GangFightsReadyTimeView.instance.hide();
            return;
        }

        /* internal  */get btn(): AttachedSoulBattlefieldIcon
        {
            if (!this._btn) 
            {
                this._btn = new AttachedSoulBattlefieldIcon();
            }
            return this._btn;
        }

        private /* var */_btn: AttachedSoulBattlefieldIcon;

        private /* var */_module: IAttachedSoulBattlefieldModule;

        private /* var */_explain: AttachedSoulBattlefieldExplainWindow;

        private /* var */_resultWindow: AttachedSoulBattlefielResultWindow;

        private /* var */_multiplicitySelectView: AttachedSoulMultiplicitySelectView;

        private /* var */_waitingTimeView: AttachedSoulBattlefieldWaitingTimeView;

        private /* var */_infoView: AttachedSoulBattlefieldInfoView;

        private /* var */_enemyView: AttachedSoulBattlefielAids;

        private /* var */_groupView: ArenaGroupView;

        private /* var */_observeView: AttachedSoulBattlefielAids;

        private /* var */_listInfoView: AttachedSoulBattlefielListInfoView;

        private /* var */_alert: Object /* flash.display.Sprite */;

        private /* var */_isInBattlefield: Boolean;

        private /* var */_alertSp: Object /* flash.display.Sprite */;
    }
